<?php

$themecolors = array(
	'bg' => 'ffffff',
	'text' => '000000',
	'link' => 'cc6600'
);

function sapphire_widgets_init() {
	register_sidebars(1, array(
		'before_widget' => '<div id="%1$s" class="widget %2$s">',
		'after_widget' => '</div>'
	));
	/*function widget_sapphire_links() {
		echo '<ul>';
		get_links_list();
		echo '</ul>';
	}*/
	function widget_sapphire_pages($args) {
		extract($args);
	?>
		<?php echo $before_widget; ?>
		<ul>
			<li class="page_item"><a href="<?php bloginfo('url'); ?>">Home</a></li>
		<?php wp_list_pages('title_li='); ?>
		</ul>
		<?php echo $after_widget; ?>
	<?php
	}

	//register_sidebar_widget(__('Links'), 'widget_sapphire_links', null, 'links');
	unregister_sidebar_widget('pages');
	register_sidebar_widget(__('Pages'), 'widget_sapphire_pages', null, 'pages');
	unregister_widget_control('pages');
}
//add_action('widgets_init', 'sapphire_widgets_init');

define('HEADER_TEXTCOLOR', 'FFFFFF');
define('HEADER_IMAGE', '%s/images/wheatgrass-masthead.jpg'); // %s is theme dir uri
define('HEADER_IMAGE_WIDTH', 740);
define('HEADER_IMAGE_HEIGHT', 180);

function header_style() {
?>
<style type="text/css">
#header{
	background: url(<?php header_image() ?>) no-repeat center;
}
<?php if ( 'blank' == get_header_textcolor() ) { ?>
#header h1, #header .description {
	display: none;
}
<?php } else { ?>
#header h1 a, .description {
	color:#<?php header_textcolor() ?>;
}
<?php } ?>
</style>
<?php
}

function sapphire_admin_header_style() {
?>
<style type="text/css">
#headimg{
	background: url(<?php header_image() ?>) no-repeat;
	background-repeat: no-repeat;
	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
	width:<?php echo HEADER_IMAGE_WIDTH; ?>px;
	font-family: Verdana, Arial, Sans-Serif;
}
#headimg h1{
font-size: 32px;
font-weight: bold;
padding-top: 60px;
text-align: center;
margin: 0;
}
#headimg h1 a{
	color:#<?php header_textcolor() ?>;
	text-decoration: none;
	border-bottom: none;
}
#headimg #desc{
	color:#<?php header_textcolor() ?>;
font-size: 15px;
text-align: center;
}

<?php if ( 'blank' == get_header_textcolor() ) { ?>
#headimg h1, #headimg #desc {
	display: none;
}
#headimg h1 a, #headimg #desc {
	color:#<?php echo HEADER_TEXTCOLOR ?>;
}
<?php } ?>

</style>
<?php
}

add_custom_image_header('header_style', 'sapphire_admin_header_style');

?>
